// Copyright 2012-present OSBI Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

@import 'styles/helpers/variables';

.toolbar-actions {
  ul {
    li {
      margin: 0 0 8px 0;
      padding-left: 5px;

      a,
      button {
        display: block;
        width: auto;
        color: $color-font;
        text-align: left;
        white-space: nowrap;

        .bp3-icon {
          margin: 0 8px 0 0;
          color: $color-font;
          vertical-align: middle;
        }

        span {
          display: inline-block;
          color: $color-font;
          vertical-align: middle;
        }

        &:hover {
          color: $color-primary;

          a,
          button {
            span {
              color: $color-primary;
            }
          }
        }
      }

      &:last-child {
        margin-bottom: 0;
      }

      &:hover {
        border-radius: 2px;
        background-color: #e4e8ed;
      }
    }
  }
}

.toolbar-slide-overlay {
  position: fixed;
  z-index: 999;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  background-color: rgba(#000, 0.3);
  content: '';
  transition: opacity 0.2s ease;
  transform: translateX(100%);
}

.toolbar-actions-open .toolbar-actions .toolbar-slide-overlay {
  opacity: 1;
  transform: translateX(0);
}

.toolbar-slide-inner {
  position: absolute;
  z-index: 9999;
  top: 0;
  bottom: 0;
  left: 0;
  width: 324px;
  color: $color-font;
  transform: translateX(-100%);

  .toolbar-slide & {
    background-color: #fff;
    transition: all 0.2s ease;
  }
}

.toolbar-actions-open .toolbar-actions .toolbar-slide-inner {
  transform: translateX(0);
}

.toolbar-slide-close {
  position: absolute;
  top: 116px;
  left: 15px;
  width: 32px;
  height: 32px;
  color: #fff;
  border-radius: 50%;
  background-color: $color-red;
  box-shadow: 0 0 20px rgba(#000, 0.08);
  cursor: pointer;
  text-align: center;

  .toolbar-actions & {
    top: 166px;
  }

  .bp3-icon {
    margin-top: 8px;
  }

  .toolbar-slide & {
    color: $color-black;
    background-color: transparent;
    box-shadow: none;
  }
}

.toolbar-slide-content {
  position: relative;
  padding: 30px 24px;
  background-color: #fff;

  .toolbar-actions & {
    margin: 160px 0 0 64px;

    .toolbar-slide & {
      margin-top: 125px;
    }
  }

  strong {
    display: block !important;
    margin: 0 0 14px 0;
    font-size: 12px;
    font-weight: 500;
    color: rgba($color-font, 0.6);
    text-transform: uppercase;
  }

  .toolbar-slide & {
    padding: 0 30px 0 0;
    box-shadow: none;
  }

  &:before {
    position: absolute;
    top: 0;
    left: -8px;
    display: block;
    width: 0;
    height: 0;
    border: 4px solid transparent;
    border-top-color: #fff;
    border-right-color: #fff;
    content: '';

    .toolbar-slide & {
      display: none;
    }
  }
}
